mini.parse();

// console.log(payMentState);
// console.log(payMentMethod);
// console.log(payMentBank);
// console.log(finalDocumentType);
var payMentState="payMentState";
var payMentMethod="payMentMethod";
var payMentBank="payMentBank";
var finalDocumentType="finalDocumentType";

// $(function () {
//     request();
// });
function request123() {

    $.ajax({
        url: ajaxUrl + "/PaymentOrder/finds.do",
        type:"post",
        data:{
            field:payMentState,
            field2:payMentMethod,
            field3:payMentBank,
            field4:finalDocumentType
        },
        success:function (data) {
            console.log(data);
            var payMentState=mini.get("payMentState");
            var payMentMethod=mini.get("payMentMethod");
            var payMentBank=mini.get("payMentBank");
            var finalDocumentType=mini.get("finalDocumentType");
            data[0].unshift([]);
            data[1].unshift([]);
            data[2].unshift([]);
            data[3].unshift([]);
            payMentState.setData(data[0]);
            payMentMethod.setData(data[1]);
            payMentBank.setData(data[2]);
            finalDocumentType.setData(data[3]);
        },
        error:function (data) {
            
        }
    })
    
}
request123();
//确定按钮
function onOk() {
    var form=new mini.Form("form");
    var data=form.getData();
    console.log(data);
    date1=formatDate(data.documentDate);
    date2=formatDate(data.documentDate2);
    var documentDate=[];
    documentDate.push(date1,date2);
    data.documentDate=documentDate;

    var amountPaid=[];
    amountPaid.push(data.amountPaid,data.amountPaid2);
    data.amountPaid=amountPaid
    delete data.amountPaid2;


    var amountPayable=[];
    amountPayable.push(data.amountPayable,data.amountPayable2);
    data.amountPayable=amountPayable;
    delete  data.amountPayable2;

    var surplusamount=[];
    surplusamount.push(data.surplusamount,data.surplusamount2);
    data.surplusamount=surplusamount;
    delete  data.surplusamount2;

    console.table(data);
    data=JSON.stringify(data);
    $.ajax({
        url: ajaxUrl + "/PaymentOrder/findLike.do",
        type:"post",
        data:{
         list:data
        },
        success:function (data) {
            console.log(data);
             data1=data;
            console.log(data1);
            CloseWindow();
        },
        error:function (data) {
        }
    })
}
function GetData() {

    var o=data1;
    return o;
}
//取消按钮
function onCancel() {
    CloseWindow("cancel");
}
//关闭子页面
function CloseWindow(action) {

    if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
    else window.close();
}
function quchong(arr) {
    var arr1=[];
    for(var i=0;i<arr.length;i++){
        if(!arr1.includes(arr[i])){
            arr1.push(arr[i])
        }
    }
    return arr1;
}